<div id="main">
<div id="contents">
<form name="wireless_basic"  method="post">
<fieldset>
<legend>&#160;<label sid="wireless_basic.wireless_network"></label>&#160;</legend>
<div class="frame_tab_layer">
     <table width="100%" border="0" cellpadding="0" cellspacing="0" class="cmenutitle">
            <!--<tr>
              <td class="frame_tab_left" ><label for="aboutDriverVersion"><script type="text/javascript">Capture(wireless_about.driver_version)</script></label>
              </td>
              <td class="frame_tab_right" id="aboutDriverVersion"></td>
            </tr>
            <tr>
              <td class="frame_tab_left" ><label for="id2291"><script type="text/javascript">Capture(wireless_basic.radio_button)</script></label>
              </td>
              <td class="frame_tab_right">
              	<input type="radio" name="id2291" id="radioButton" value="1">&#160;<script type="text/javascript">Capture(wireless.on)</script>
              	<span style="padding-left:20px;"></span>
              	<input type="radio" name="id2291" id="radioButton" value="0">&#160;<script type="text/javascript">Capture(wireless.off)</script>
              </td>
            </tr>-->
            <tr>
              <td class="frame_tab_left" ><label for="id2292"><label sid="wireless_basic.wifi_button"></label></label>
              </td>
              <td class="frame_tab_right">
              	<input type="radio" name="id2292" id="id2292" value="on" checked>&#160;<label sid="wireless.on"></label>
              	<span style="padding-left:20px;"></span>
              	<input type="radio" name="id2292" id="id2292" value="off">&#160;<label sid="wireless.off"></label>
              </td>
            </tr>
          </table>
            <table width="100%" border="0" cellpadding="0" cellspacing="0" class="cmenutitle">
            <tr>
              <td class="frame_tab_left" ><label for="id2165"><label sid="wireless_basic.network_mode"></label></label>
              </td>
              <td class="frame_tab_right">
              	<select name="id2165" id="id2165" onChange="id2165Change()">
        					<option value=0>802.11b+g</option>
        					<option value=1>802.11b</option>
        					<option value=4>802.11g</option>
        					<option value=9>802.11b+g+n</option>
							<option value=6>802.11n</option>
      					</select>
              </td>
            </tr>
             <tr>
              <td class="frame_tab_left" ><label for="id2164"><label sid="wireless_basic.ssid"></label></label>
              </td>
              <td class="frame_tab_right">
              	<input type="text" name="id2164" id="id2164" size="30" maxlength="30"/>
              </td>
            </tr>
            <tr>
              <td class="frame_tab_left" ><label for="id2198"><label sid="wireless_basic.broadcast_ssid"></label></label>
              </td>
              <td class="frame_tab_right">
              	<input type="radio" name="id2198" id="id2198" value="0">&#160;<label sid="main.enable"></label>
              	<span style="padding-left:20px;"></span>
              	<input type="radio" name="id2198" id="id2198" value="1">&#160;<label sid="main.disable"></label>
              </td>
            </tr>
            <tr>
              <td class="frame_tab_left" ><label for="bssid"><label sid="wireless_basic.bssid"></label></label>
              </td>
              <td class="frame_tab_right" id="bssid"></td>
            </tr>
            <tr>
              <td class="frame_tab_left" ><label for="id2196"><label sid="wireless_basic.apisolated"></label></label>
              </td>
              <td class="frame_tab_right">
              	<input type="radio" name="id2196" id="id2196" value="1">&#160;<label sid="main.enable"></label>
              	<span style="padding-left:20px;"></span>
              	<input type="radio" name="id2196" id="id2196" value="0">&#160;<label sid="main.disable"></label>
              </td>
            </tr>
            <tr id="div_mbssidapisolated">
              <td class="frame_tab_left" ><label for="id2197"><label sid="wireless_basic.mbssidapisolated"></label></label>
              </td>
              <td class="frame_tab_right">
              	<input type="radio" name="id2197" id="id2197" value="1">&#160;<label sid="main.enable"></label>
              	<span style="padding-left:20px;"></span>
              	<input type="radio" name="id2197" id="id2197" value="0">&#160;<label sid="main.disable"></label>
              </td>
            </tr>
            <tr id="div_11a_channel" name="div_11a_channel">
              <td class="frame_tab_left" ><label for="id2167"><label sid="wireless_basic.frequency"></label></label>
              </td>
              <td class="frame_tab_right">
              	<select id="id2167" name="id2167" onclick="ChOnChange();">
						<option value=0 id="basicFreqAAuto" sid="wireless_basic.ht_guard_interval_select1"></option>
						<option value=1 >1</option>
						<option value=2 >2</option>
						<option value=3 >3</option>
						<option value=4 >4</option>
						<option value=5 >5</option>
						<option value=6 >6</option>
						<option value=7 >7</option>
						<option value=8 >8</option>
						<option value=9 >9</option>
						<option value=10 >10</option>
						<option value=11 >11</option>
						<option value=12 >12</option>
						<option value=13 >13</option>
						<!--<option value=14>2477MHz (14)</option>-->
						
				</select>
              </td>
            </tr>
  <tr id="div_abg_rate">
    <td class="frame_tab_left"><font id="basicRate"><label sid="wireless_basic.rate"></label></font></td>
    <td class="frame_tab_right">
      <select name="abg_rate" id="abg_rate">
      </select>
    </td>
  </tr>
</table>
</div>
</fieldset>
<fieldset id="div_11n" style="display: none">
<legend>&#160;<label sid="wireless_basic.title2"></label>&#160;</legend>
<div class="frame_tab_layer">
     <table width="100%" border="0" cellpadding="0" cellspacing="0" class="cmenutitle">
            <tr>
              <td class="frame_tab_left" ><label for="id2245"><label sid="wireless_basic.ht_op_mode"></label></label></td>
              <td class="frame_tab_right">
              	<input type="radio" name="id2245" id="id2245" value="0" checked>&#160;<label sid="wireless_basic.ht_op_mixed"></label>
              	<span style="padding-left:20px;"></span>
              	<input type="radio" name="id2245" id="id2245" value="1">&#160;<label sid="wireless_basic.ht_op_green"></label>
              </td>
            </tr>
            <tr>
              <td class="frame_tab_left" ><label for="id2248"><label sid="wireless_basic.ht_channel_bandwidth"></label></label></td>
              <td class="frame_tab_right">
              	<input type="radio" name="id2248" id="id2248" value="0" onClick="ChBwOnClick()" checked>&#160;20 MHz
              	<span style="padding-left:20px;"></span>
              	<input type="radio" name="id2248" id="id2248" value="1" onClick="ChBwOnClick()">&#160;20/40 MHz
              </td>
            </tr>
             <tr>
              <td class="frame_tab_left" ><label for="id2253"><label sid="wireless_basic.ht_guard_interval"></label></label></td>
              <td class="frame_tab_right">
              	<input type="radio" name="id2253" id="id2253" value="1">&#160;<label sid="wireless_basic.ht_guard_interval_select1"></label>
              	<span style="padding-left:20px;"></span>
              	<input type="radio" name="id2253" id="id2253" value="0">&#160;<label sid="wireless_basic.ht_guard_interval_select2"></label>
              </td>
            </tr>
            <tr>
              <td class="frame_tab_left" ><label for="id2255"><label sid="wireless_basic.mcs"></label></label></td>
              <td class="frame_tab_right">
              	<select name="id2255" id="id2255">
								<option value="0">0</option>
								<option value="1">1</option>
								<option value="2">2</option>
								<option value="3">3</option>
								<option value="4">4</option>
								<option value="5">5</option>
								<option value="6">6</option>
								<option value="7">7</option>
								<option value="8">8</option>
								<option value="9">9</option>
								<option value="10">10</option>
								<option value="11">11</option>
								<option value="12">12</option>
								<option value="13">13</option>
								<option value="14">14</option>
								<option value="15">15</option>
								<option value="32">32</option>
								<option value="33" selected id="basicHTAutoMCS" sid="wireless.auto"></option>
     					 </select>
              </td>
            </tr>
           <tr name="extension_channel" id="extension_channel">
              <td class="frame_tab_left" ><label for="id2247"><label sid="wireless_basic.ht_extension_channel"></label></label></td>
              <td class="frame_tab_right">
              	<select name="id2247" id="id2247">
              		<option>&#160;</option>
     			</select>
              </td>
            </tr>
            <tr>
              <td class="frame_tab_left" ><label for="id2243"><label sid="wireless_basic.ht_rdg"></label></label></td>
              <td class="frame_tab_right">
              	<input type="radio" name="id2243" id="id2243" value="1">&#160;<label sid="main.enable"></label>
              	<span style="padding-left:20px;"></span>
              	<input type="radio" name="id2243" id="id2243" value="0" checked>&#160;<label sid="main.disable"></label>
              </td>
            </tr>
            <tr>
              <td class="frame_tab_left" ><label for="id2254"><label sid="wireless_basic.ht_stbc"></label></label></td>
              <td class="frame_tab_right">
              	<input type="radio" name="id2254" id="n_stbc_1" value="1">&#160;<label sid="main.enable"></label>
              	<span style="padding-left:20px;"></span>
              	<input type="radio" name="id2254" id="n_stbc_2" value="0" checked>&#160;<label sid="main.disable"></label>
              </td>
            </tr>
            <tr>
              <td class="frame_tab_left" ><label for="id2251"><label sid="wireless_basic.ht_amsdu"></label></label></td>
              <td class="frame_tab_right">
              	<input type="radio" name="id2251" id="n_amsdu_1" value="1">&#160;<label sid="main.enable"></label>
              	<span style="padding-left:20px;"></span>
              	<input type="radio" name="id2251" id="n_amsdu_2" value="0" checked>&#160;<label sid="main.disable"></label>
              </td>
            </tr>
            <tr>
              <td class="frame_tab_left" ><label for="id2249"><label sid="wireless_basic.ht_addba"></label></label></td>
              <td class="frame_tab_right">
              	<input type="radio" name="id2249" id="n_autoba_1" value="1">&#160;<label sid="main.enable"></label>
              	<span style="padding-left:20px;"></span>
              	<input type="radio" name="id2249" id="n_autoba_2" value="0" checked>&#160;<label sid="main.disable"></label>
              </td>
            </tr>
            <tr>
              <td class="frame_tab_left" ><label for="id2250"><label sid="wireless_basic.ht_delba"></label></label></td>
              <td class="frame_tab_right">
              	<input type="radio" name="id2250" id="n_badecline_1" value="1">&#160;<label sid="main.enable"></label>
              	<span style="padding-left:20px;"></span>
              	<input type="radio" name="id2250" id="n_badecline_2" value="0" checked>&#160;<label sid="main.disable"></label>
            </tr>
            <tr>
              <td class="frame_tab_left" ><label for="id2261"><label sid="wireless_basic.TKIP"></label></label></td>
              <td class="frame_tab_right">
              	<input type="radio" name="id2261" id="n_disallow_tkip_1" value="1">&#160;<label sid="main.enable"></label>
              	<span style="padding-left:20px;"></span>
              	<input type="radio" name="id2261" id="n_disallow_tkip_2" value="0" checked>&#160;<label sid="main.disable"></label>
              </td>
            </tr>
            <!--<tr id="div_2040_coexit">
              <td class="frame_tab_left" ><label for="id2262">20/40 Coexistence</label></td>
              <td class="frame_tab_right">
              	<input type="radio" name="id2262" id="id2262" value="1">&#160;<script type="text/javascript">Capture(main.enable)</script>
              	<span style="padding-left:20px;"></span>
              	<input type="radio" name="id2262" id="id2262" value="0" checked>&#160;<script type="text/javascript">Capture(main.disable)</script>
              </td>
            </tr>-->
          </table>
           </div>
		</fieldset>

	<!--	<fieldset>
    <legend>&#160;<script type="text/javascript">Capture(wireless_basic.other)</script>&#160;</legend>
       <div class="frame_tab_layer">
            <table width="100%" border="0" cellpadding="0" cellspacing="0" class="cmenutitle">
            <tr>
              <td class="frame_tab_left" ><label for="id2259"><script type="text/javascript">Capture(wireless_basic.ht_txstream)</script></label></td>
              <td class="frame_tab_right">
              	<select name="id2259" id="id2259">
								<option value = 1>1</option>
								<option value = 2 id="div_HtTx2Stream">2</option>
     					 </select>
              </td>
            </tr>
            <tr>
              <td class="frame_tab_left" ><label for="id2260"><script type="text/javascript">Capture(wireless_basic.ht_rxstream)</script></label></td>
              <td class="frame_tab_right">
              	<select name="id2260" id="id2260">
								<option value = 1>1</option>
								<option value = 2 id="div_HtRx2Stream">2</option>
     					 </select>
              </td>
            </tr>
          </table>
            </div>
		</fieldset>-->

		<div class="submitFooter">
<script type="text/javascript">

var buttonInfo = submitFooterButton(1,0);
$(".submitFooter").html(buttonInfo);

</script>
</div>
</form>
</div>
</div>
<br/>
<div id="helpContainer">
<div id="help">
<div><h2><img src="images/help_title.png" border="0"/><label sid="share.help"></label></h2></div>
    <div id="helpBody">
    <dl>

        <dt class="term">
            <label sid="wireless_basic.ssid"></label>
        </dt>
        <dd class="definition">
            <label sid="wireless_basic.ssid_note"></label>
        </dd>
    <dt class="term">
        <label sid="wireless_basic.broadcast_ssid"></label>
    </dt>
    <dd class="definition">
        <label sid="wireless_basic.broadcast_ssid_note"></label>
    </dd>
    <dt class="term">
        <label sid="wireless_basic.apisolated"></label>
    </dt>
    <dd class="definition">
        <label sid="wireless_basic.apisolated_note1"></label><br>
        <label sid="wireless_basic.apisolated_note2"></label>
    </dd>
    <dt class="term">
        <label sid="wireless_basic.mbssidapisolated"></label>
    </dt>
    <dd class="definition">
        <label sid="wireless_basic.mbssidapisolated_note"></label>
    </dd>
        <dt class="term">
            <label sid="wireless_basic.frequency"></label>
        </dt>
        <dd class="definition">
            <label sid="wireless_basic.frequency_note"></label>
        </dd>
        <dt class="term">
            <label sid="wireless_basic.title2"></label>
        </dt>
        <dd class="definition">
            <label sid="wireless_basic.title2_tip"></label>
        </dd>
        <dt class="term">
            <label sid="wireless_basic.ht_op_mode"></label>
        </dt>
        <dd class="definition">
            <label sid="wireless_basic.ht_op_mixed"></label><br>
            <label sid="wireless_basic.ht_op_mixed_tip"></label><br><br>
            <label sid="wireless_basic.ht_op_green"></label><br>
            <label sid="wireless_basic.ht_op_green_tip"></label>
        </dd>


        <dt class="term">
            <label sid="wireless_basic.ht_channel_bandwidth"></label>
        </dt>
        <dd class="definition">
            <label sid="wireless_basic.ht_channel_bandwidth_note"></label>
        </dd>
        <dt class="term">
            <label sid="wireless_basic.ht_guard_interval"></label>
        </dt>
        <dd class="definition">
            <label sid="wireless_basic.ht_guard_interval_tip"></label>
        </dd>
        <dt class="term">
            <label sid="wireless_basic.mcs"></label>
        </dt>
        <dd class="definition">
            <label sid="wireless_basic.mcs_note"></label>
        </dd>
        <dt class="term">
            <label sid="wireless_basic.ht_extension_channel"></label>
        </dt>
        <dd class="definition">
            <label sid="wireless_basic.ht_extension_channel_tip"></label>
        </dd>
        <dt class="term">
            <label sid="wireless_basic.ht_rdg"></label>
        </dt>
        <dd class="definition">
            <label sid="wireless_basic.ht_rdg_note"></label>
        </dd>
        <dt class="term">
            <label sid="wireless_basic.ht_stbc"></label>
        </dt>
        <dd class="definition">
            <label sid="wireless_basic.ht_stbc_note"></label>
        </dd>
        <dt class="term">
            <label sid="wireless_basic.ht_amsdu"></label>
        </dt>
        <dd class="definition">
            <label sid="wireless_basic.ht_amsdu_note"></label>
        </dd>
        <dt class="term">
        <label sid="wireless_basic.ht_addba"></label>
    </dt>
        <dd class="definition">
            <label sid="wireless_basic.ht_addba_note"></label>
        </dd>
        <dt class="term">
            <label sid="wireless_basic.ht_delba"></label>
        </dt>
        <dd class="definition">
            <label sid="wireless_basic.ht_delba_note"></label>
        </dd>
        <dt class="term">
            <label sid="wireless_basic.TKIP"></label>
        </dt>
        <dd class="definition">
            <label sid="wireless_basic.TKIP_note"></label>
        </dd>
</dl>
  </div>

</div>
</div>







<script type="text/javascript">

var PhyMode  = '';
var APIsolated = '';
var mbssidapisolated = '';
var ChIdx  = '1';
var fxtxmode = '';
var CntyCd = '';
var ht_bw = '';
var ht_mcs = '';
var ht_extcha = '';
var apcli_include = '1';
var draft3b = '0';
var mesh_include = '0';
var tx_stream_idx = '';
var rx_stream_idx = '';
var is3t3r = '0';
var txpath = '';
var rxpath = '';
var rfic = "";

ChLst_24G = new Array(14);
ChLst_24G[0] = "1";
ChLst_24G[1] = "2";
ChLst_24G[2] = "3";
ChLst_24G[3] = "4";
ChLst_24G[4] = "5";
ChLst_24G[5] = "6";
ChLst_24G[6] = "7";
ChLst_24G[7] = "8";
ChLst_24G[8] = "9";
ChLst_24G[9] = "10";
ChLst_24G[10] = "11";
ChLst_24G[11] = "12";
ChLst_24G[12] = "13";
ChLst_24G[13] = "14";


HT5GExtCh = new Array(22);
HT5GExtCh[0] = new Array(1, "40"); //36's extension channel
HT5GExtCh[1] = new Array(0, "36"); //40's extension channel
HT5GExtCh[2] = new Array(1, "48"); //44's
HT5GExtCh[3] = new Array(0, "44"); //48's
HT5GExtCh[4] = new Array(1, "56"); //52's
HT5GExtCh[5] = new Array(0, "52"); //56's
HT5GExtCh[6] = new Array(1, "64"); //60's
HT5GExtCh[7] = new Array(0, "60"); //64's
HT5GExtCh[8] = new Array(1, "104"); //100's
HT5GExtCh[9] = new Array(0, "100"); //104's
HT5GExtCh[10] = new Array(1, "112"); //108's
HT5GExtCh[11] = new Array(0, "108"); //112's
HT5GExtCh[12] = new Array(1, "120"); //116's
HT5GExtCh[13] = new Array(0, "116"); //120's
HT5GExtCh[14] = new Array(1, "128"); //124's
HT5GExtCh[15] = new Array(0, "124"); //128's
HT5GExtCh[16] = new Array(1, "136"); //132's
HT5GExtCh[17] = new Array(0, "132"); //136's
HT5GExtCh[18] = new Array(1, "153"); //149's
HT5GExtCh[19] = new Array(0, "149"); //153's
HT5GExtCh[20] = new Array(1, "161"); //157's
HT5GExtCh[21] = new Array(0, "157"); //161's

	var nonames = new Array("abg_rate","submit","id2167");
	var sendtext = getSendText(nonames);
	sendtext += "&id=2200&id=2167&id=2287&id=2290&id=2162&id=2288&id=2289";
	DataRequest("get_json",sendtext,function(data){
  	getResult(nonames,data);
  	PhyMode = data["id2165"];
  	mbssidapisolated = data["id2197"];
  	fxtxmode = data["id2290"];
  	CntyCd = data["id2162"];
  	ht_bw = data["id2248"];
  	ht_mcs = data["id2255"];
  	ht_extcha = data["id2247"];
  	tx_stream_idx = data["id2259"];
  	rx_stream_idx = data["id2260"];
  	txpath = data["id2288"];
	rxpath = data["id2289"];
	rfic = data["id2287"];
		if (CntyCd == ''){
		CntyCd = 'NONE';
	}else if(CntyCd=="US"||CntyCd=="TW"){
		$("#id2167").html('<option value=0 id="basicFreqAAuto" sid="wireless_basic.ht_guard_interval_select1">'+wireless_basic.ht_guard_interval_select1+'</option><option value=1 >2412MHz (Channel 1)</option><option value=2 >2417MHz (Channel 2)</option><option value=3 >2422MHz (Channel 3)</option><option value=4 >2427MHz (Channel 4)</option><option value=5 >2432MHz (Channel 5)</option><option value=6 >2437MHz (Channel 6)</option><option value=7 >2442MHz (Channel 7)</option><option value=8 >2447MHz (Channel 8)</option><option value=9 >2452MHz (Channel 9)</option><option value=10 >2457MHz (Channel 10)</option><option value=11 >2462MHz (Channel 11)</option>');
	}else if(CntyCd=="FR"||CntyCd=="HK"||CntyCd=="IE"){
		$("#id2167").html('<option value=0 id="basicFreqAAuto" sid="wireless_basic.ht_guard_interval_select1">'+wireless_basic.ht_guard_interval_select1+'</option><option value=1 >2412MHz (Channel 1)</option><option value=2 >2417MHz (Channel 2)</option><option value=3 >2422MHz (Channel 3)</option><option value=4 >2427MHz (Channel 4)</option><option value=5 >2432MHz (Channel 5)</option><option value=6 >2437MHz (Channel 6)</option><option value=7 >2442MHz (Channel 7)</option><option value=8 >2447MHz (Channel 8)</option><option value=9 >2452MHz (Channel 9)</option><option value=10 >2457MHz (Channel 10)</option><option value=11 >2462MHz (Channel 11)</option><option value=12>2467MHz (Channel 12)</option><option value=13>2472MHz (Channel 13)</option>');
	}else{
		$("#id2167").html('<option value=0 id="basicFreqAAuto" sid="wireless_basic.ht_guard_interval_select1">'+wireless_basic.ht_guard_interval_select1+'</option><option value=1 >2412MHz (Channel 1)</option><option value=2 >2417MHz (Channel 2)</option><option value=3 >2422MHz (Channel 3)</option><option value=4 >2427MHz (Channel 4)</option><option value=5 >2432MHz (Channel 5)</option><option value=6 >2437MHz (Channel 6)</option><option value=7 >2442MHz (Channel 7)</option><option value=8 >2447MHz (Channel 8)</option><option value=9 >2452MHz (Channel 9)</option><option value=10 >2457MHz (Channel 10)</option><option value=11 >2462MHz (Channel 11)</option><option value=12>2467MHz (Channel 12)</option><option value=13>2472MHz (Channel 13)</option><option value=14>2484MHz (Channel 14)</option>');
		}

	if(data["id2200"]==1){
		listselect("id2167",0);
		}else{
			listselect("id2167",data['id2167']);
			}
  	initValue();
  	getbssid();
  });


 function getbssid(){
 	DataRequest("/cgi-bin/stat?bssid","",function(data){
		var tmpvalue = data["bssid"];
		$("#bssid").html(tmpvalue);
         height_div();
	});
 	}

	$("[name=submit]").click(function () {
		var nonames = new Array("abg_rate","id2167","submit");
		if(CheckValue()){
		$(".errormsg").html('');
		var settext = getSetText(nonames);
		var id2165 = $("#id2165").val();
		var id2167 = $("#id2167").val();
		var rate = $("#abg_rate").val();

		if(id2167==0){
			settext+="&id2200=1&id2167="+id2167;
			}else{
				settext+="&id2200=0&id2167="+id2167;
			}

		if (id2165=="0" || id2165=="2"  || id2165=="4" ) {
			if (rate == 1 || rate == 2 || rate == 5 || rate == 11)
				settext+="&id2290=CCK";
			else
				settext+="&id2290=OFDM";

			if (rate == 1)
				settext+="&id2255=0";
			else if (rate == 2)
				settext+="&id2255=1";
			else if (rate == 5)
				settext+="&id2255=2";
			else if (rate == 6)
				settext+="&id2255=0";
			else if (rate == 9)
				settext+="&id2255=1";
			else if (rate == 11)
				settext+="&id2255=3";
			else if (rate == 12)
				settext+="&id2255=2";
			else if (rate == 18)
				settext+="&id2255=3";
			else if (rate == 24)
				settext+="&id2255=4";
			else if (rate == 36)
				settext+="&id2255=5";
			else if (rate == 48)
				settext+="&id2255=6";
			else if (rate == 54)
				settext+="&id2255=7";
			else
				settext+="&id2255=33";
		}
		else if (id2165== "1") {
			settext+="&id2290=CCK";
			if (rate == 1)
				settext+="&id2255=0";
			else if (rate == 2)
				settext+="&id2255=1";
			else if (rate == 5)
				settext+="&id2255=2";
			else if (rate == 11)
				settext+="&id2255=3";
		}
		settext=settext.replace(/\#/g,"%23");
		submitform(modules["set_data"],settext);
	}
	});

function StylDispOn()
{
	if (window.ActiveXObject)
	{ // IE
		return "block";
	}
	else if (window.XMLHttpRequest)
	{ // Mozilla, Safari,...
		return "table-row";
	}
}
function ChBwOnClick()
{
	var w_mode = document.wireless_basic.id2165.options.selectedIndex;

	if (document.wireless_basic.id2248[0].checked == true)
	{
		document.getElementById("extension_channel").style.visibility = "hidden";
		document.getElementById("extension_channel").style.display = "none";
		document.wireless_basic.id2247.disabled = true;
	}
	else
	{
		document.getElementById("extension_channel").style.visibility = "visible";
		document.getElementById("extension_channel").style.display = StylDispOn();
		document.wireless_basic.id2247.disabled = false;

		if ((w_mode == 6) || (w_mode == 7))
		{
			if (document.wireless_basic.id2167.options.selectedIndex == 0)
			{
				document.getElementById("extension_channel").style.visibility = "hidden";
				document.getElementById("extension_channel").style.display = "none";
				document.wireless_basic.id2247.disabled = true;
			}
		}
	}
}

function ChOnChange()
{
	if (document.wireless_basic.id2248[1].checked == true)
	{
		var w_mode = document.wireless_basic.id2165.options.selectedIndex;

		if ((w_mode == 6) || (w_mode == 7))
		{
			if (document.wireless_basic.id2248[1].checked == true)
			{
				document.getElementById("extension_channel").style.visibility = "visible";
				document.getElementById("extension_channel").style.display = StylDispOn();
				document.wireless_basic.id2247.disabled = false;
			}

			if (document.wireless_basic.id2167.options.selectedIndex == 0)
			{
				document.getElementById("extension_channel").style.visibility = "hidden";
				document.getElementById("extension_channel").style.display = "none";
				document.wireless_basic.id2247.disabled = true;
			}
		}
		else if ((w_mode == 3) || (w_mode == 4))
		{
			if (document.wireless_basic.id2248[1].checked == true)
			{
				document.getElementById("extension_channel").style.visibility = "visible";
				document.getElementById("extension_channel").style.display = StylDispOn();
				document.wireless_basic.id2247.disabled = false;
			}

			if (document.wireless_basic.id2167.options.selectedIndex == 0)
			{
				document.getElementById("extension_channel").style.visibility = "hidden";
				document.getElementById("extension_channel").style.display = "none";
				document.wireless_basic.id2247.disabled = true;
			}
		}
	}

	InsExtChOpt();
}

function CreateExtChOpt(vChannel)
{
	var y = document.createElement('option');

	y.text = ChLst_24G[1*vChannel - 1];
//	y.value = 1*vChannel;
	y.value = 1;

	var x = document.getElementById("id2247");

	try
	{
		x.add(y,null); // standards compliant
	}
	catch(ex)
	{
		x.add(y); // IE only
	}
}

function InsExtChOpt()
{
	var wmode = document.wireless_basic.id2165.options.selectedIndex;
	var OptLen;
	var CurrCh;

	if ((wmode== 6) || (wmode== 3) || (wmode== 4) || (wmode== 7))
	{
		var x = document.getElementById("id2247");
		var length = document.wireless_basic.id2247.options.length;

		if (length > 1)
		{
			x.selectedIndex = 1;
			x.remove(x.selectedIndex);
		}

		if ((wmode== 6) || (wmode== 7))
		{
			CurrCh = document.wireless_basic.id2167.value;
			x.options[0].text = "Auto Select";
			x.options[0].value = 0;
		}
		else if ((wmode== 3) || (wmode== 4))
		{
			CurrCh = document.wireless_basic.id2167.value;
			OptLen = document.wireless_basic.id2167.options.length;

			if ((CurrCh >=1) && (CurrCh <= 4))
			{
				x.options[0].text = ChLst_24G[1*CurrCh + 4 - 1];
				x.options[0].value = 1;
			}
			else if ((CurrCh >= 5) && (CurrCh <= 7))
			{
				x.options[0].text = ChLst_24G[1*CurrCh - 4 - 1];
				x.options[0].value = 0; //1*CurrCh - 4;
				CurrCh = 1*CurrCh;
				CurrCh += 4;
				CreateExtChOpt(CurrCh);
			}
			else if ((CurrCh >= 8) && (CurrCh <= 9))
			{
				x.options[0].text = ChLst_24G[1*CurrCh - 4 - 1];
				x.options[0].value = 0; //1*CurrCh - 4;

				if (OptLen >=14)
				{
					CurrCh = 1*CurrCh;
					CurrCh += 4;
					CreateExtChOpt(CurrCh);
				}
			}
			else if (CurrCh == 10)
			{
				x.options[0].text = ChLst_24G[1*CurrCh - 4 - 1];
				x.options[0].value = 0; //1*CurrCh - 4;

				if (OptLen > 14)
				{
					CurrCh = 1*CurrCh;
					CurrCh += 4;
					CreateExtChOpt(CurrCh);
				}
			}
			else if (CurrCh >= 11)
			{
				x.options[0].text = ChLst_24G[1*CurrCh - 4 - 1];
				x.options[0].value = 0; //1*CurrCh - 4;
			}
			else
			{
				x.options[0].text = "Auto Select";
				x.options[0].value = 0;
			}
		}
	}
}


function initValue()
{
	var mssidb = "1";
	var i = 0;

	if ((PhyMode >= 8) || (PhyMode == 6))
	{
		document.wireless_basic.id2245.disabled = false;
		document.wireless_basic.id2248.disabled = false;
		document.wireless_basic.id2243.disabled = false;
		document.wireless_basic.id2253.disabled = false;
		document.wireless_basic.id2255.disabled = false;
	}

	if ((rfic == "2") || (rfic == "4") || (rfic == "a") || (rfic == "d"))
	{
		document.wireless_basic.id2165.options[5] = new Option("11a only", "2");
                document.wireless_basic.id2165.options[6] = new Option("11a/n mixed mode", "8");
                document.wireless_basic.id2165.options[7] = new Option("11n only(5G)", "11");
	}
	if ((PhyMode == 0) || (PhyMode == 4) || (PhyMode == 9) || (PhyMode == 6))
	{
		if (PhyMode == 0)
			document.wireless_basic.id2165.options.selectedIndex = 0;
		else if (PhyMode == 4)
			document.wireless_basic.id2165.options.selectedIndex = 2;
		else if (PhyMode == 9)
			document.wireless_basic.id2165.options.selectedIndex = 3;
		else if (PhyMode == 6)
			document.wireless_basic.id2165.options.selectedIndex = 4;
	}
	else if ((PhyMode == 2) || (PhyMode == 8) || (PhyMode == 11))
	{
		if (PhyMode == 2)
			document.wireless_basic.id2165.options.selectedIndex = 5;
		else if (PhyMode == 8)
			document.wireless_basic.id2165.options.selectedIndex = 6;
		else if (PhyMode == 11)
			document.wireless_basic.id2165.options.selectedIndex = 7;
		document.wireless_basic.id2167.disabled = false;
	}

	if (1*ht_bw == 0)
	{
		document.wireless_basic.id2248[0].checked = true;
		document.getElementById("extension_channel").style.visibility = "hidden";
		document.getElementById("extension_channel").style.display = "none";
		document.wireless_basic.id2247.disabled = true;
	}
	else
	{
		document.wireless_basic.id2248[1].checked = true;
		document.getElementById("extension_channel").style.visibility = "visible";
		document.getElementById("extension_channel").style.display = StylDispOn();
		document.wireless_basic.id2247.disabled = false;
	}

	ChIdx = 1*ChIdx;

	if ((PhyMode == 0) || (PhyMode == 4) || (PhyMode == 6) || (PhyMode == 7) || (PhyMode == 9))
	{
		if ((CntyCd == 'US' || CntyCd == 'TW') && (ChIdx < 1 || ChIdx > 11))
	{
			document.wireless_basic.id2167.options.selectedIndex = 0;
			}
		else if ((CntyCd == 'FR' || CntyCd == 'IE' || CntyCd == 'HK') && (ChIdx < 1 || ChIdx > 13))
			{
			document.wireless_basic.id2167.options.selectedIndex = 0;
			}
		else if (CntyCd == 'JP' && (ChIdx < 1 || ChIdx > 14))
			{
			document.wireless_basic.id2167.options.selectedIndex = 0;
			}
			else
			{
			if (ChIdx < 1 || ChIdx > 14)
				document.wireless_basic.id2167.options.selectedIndex = 0;
			}
		}
	else if (PhyMode == 1)
			{
		if ((CntyCd == 'US' || CntyCd == 'TW') && (ChIdx < 1 || ChIdx > 11))
			{
			document.wireless_basic.id2167.options.selectedIndex = 0;
			}
		else if ((CntyCd == 'FR' || CntyCd == 'IE' || CntyCd == 'HK') && (ChIdx < 1 || ChIdx > 13))
			{
			document.wireless_basic.id2167.options.selectedIndex = 0;
		}
		else if (CntyCd == 'JP' && (ChIdx < 1 || ChIdx > 14))
			{
			document.wireless_basic.id2167.options.selectedIndex = 0;
			}
			else
			{
			if (ChIdx < 1 || ChIdx > 14)
				document.wireless_basic.id2167.options.selectedIndex = 0;
			}
		}
	else if ((PhyMode == 2) || (PhyMode == 8) || (PhyMode == 11))
		{
		if (CntyCd == 'HK' && (ChIdx < 36 || (ChIdx > 64 && ChIdx < 149) || ChIdx > 165))
			{
			document.wireless_basic.id2167.options.selectedIndex = 0;
			}
		else if (CntyCd == 'IE' && (ChIdx < 36 || (ChIdx > 64 && ChIdx < 100) || ChIdx > 140))
			{
			document.wireless_basic.id2167.options.selectedIndex = 0;
			}
		else if (CntyCd == 'FR' && (ChIdx < 36 || ChIdx > 64))
			{
			document.wireless_basic.id2167.options.selectedIndex = 0;
		}
		else if (CntyCd == 'JP' && (ChIdx < 36 || ChIdx > 48))
			{
			document.wireless_basic.id2167.options.selectedIndex = 0;
			}
		else if (CntyCd == 'US' && (ChIdx < 36 || (ChIdx > 64 && ChIdx < 100) || (ChIdx > 140 && ChIdx < 149) || ChIdx > 165))
			{
			document.wireless_basic.id2167.options.selectedIndex = 0;
			}
		else if (CntyCd == 'TW' && (ChIdx < 52 || ChIdx > 64))
		{
			document.wireless_basic.id2167.options.selectedIndex = 0;
		}
		else
		{
			if (ChIdx < 36 || (ChIdx > 64 && ChIdx < 100) || (ChIdx > 140 && ChIdx < 149) || ChIdx > 165)
				document.wireless_basic.id2167.options.selectedIndex = 0;
		}
	}

	//ABG Rate
	if ((PhyMode == 0) || (PhyMode == 2) || (PhyMode == 4))
	{
		document.wireless_basic.abg_rate.options.length = 0;
		document.wireless_basic.abg_rate.options[0] = new Option("Auto", "0");
		document.wireless_basic.abg_rate.options[1] = new Option("1 Mbps", "1");
		document.wireless_basic.abg_rate.options[2] = new Option("2 Mbps", "2");
		document.wireless_basic.abg_rate.options[3] = new Option("5.5 Mbps", "5");
		document.wireless_basic.abg_rate.options[4] = new Option("6 Mbps", "6");
		document.wireless_basic.abg_rate.options[5] = new Option("9 Mbps", "9");
		document.wireless_basic.abg_rate.options[6] = new Option("11 Mbps", "11");
		document.wireless_basic.abg_rate.options[7] = new Option("12 Mbps", "12");
		document.wireless_basic.abg_rate.options[8] = new Option("18 Mbps", "18");
		document.wireless_basic.abg_rate.options[9] = new Option("24 Mbps", "24");
		document.wireless_basic.abg_rate.options[10] = new Option("36 Mbps", "36");
		document.wireless_basic.abg_rate.options[11] = new Option("48 Mbps", "48");
		document.wireless_basic.abg_rate.options[12] = new Option("54 Mbps", "54");
		if (fxtxmode == "CCK" || fxtxmode == "cck") {
			if (ht_mcs.indexOf("33") == 0)
				document.wireless_basic.abg_rate.options.selectedIndex = 0;
			else if (ht_mcs.indexOf("0") == 0)
				document.wireless_basic.abg_rate.options.selectedIndex = 1;
			else if (ht_mcs.indexOf("1") == 0)
				document.wireless_basic.abg_rate.options.selectedIndex = 2;
			else if (ht_mcs.indexOf("2") == 0)
				document.wireless_basic.abg_rate.options.selectedIndex = 3;
			else if (ht_mcs.indexOf("3") == 0)
				document.wireless_basic.abg_rate.options.selectedIndex = 6;
		}
		else {
			if (ht_mcs.indexOf("33") == 0)
				document.wireless_basic.abg_rate.options.selectedIndex = 0;
			else if (ht_mcs.indexOf("0") == 0)
				document.wireless_basic.abg_rate.options.selectedIndex = 4;
			else if (ht_mcs.indexOf("1") == 0)
				document.wireless_basic.abg_rate.options.selectedIndex = 5;
			else if (ht_mcs.indexOf("2") == 0)
				document.wireless_basic.abg_rate.options.selectedIndex = 7;
			else if (ht_mcs.indexOf("3") == 0)
				document.wireless_basic.abg_rate.options.selectedIndex = 8;
			else if (ht_mcs.indexOf("4") == 0)
				document.wireless_basic.abg_rate.options.selectedIndex = 9;
			else if (ht_mcs.indexOf("5") == 0)
				document.wireless_basic.abg_rate.options.selectedIndex = 10;
			else if (ht_mcs.indexOf("6") == 0)
				document.wireless_basic.abg_rate.options.selectedIndex = 11;
			else if (ht_mcs.indexOf("7") == 0)
				document.wireless_basic.abg_rate.options.selectedIndex = 12;
		}
	}
	else if (PhyMode == 1)
	{
		document.wireless_basic.abg_rate.options.length = 0;
		document.wireless_basic.abg_rate.options[0] = new Option("Auto", "0");
		document.wireless_basic.abg_rate.options[1] = new Option("1 Mbps", "1");
		document.wireless_basic.abg_rate.options[2] = new Option("2 Mbps", "2");
		document.wireless_basic.abg_rate.options[3] = new Option("5.5 Mbps", "5");
		document.wireless_basic.abg_rate.options[4] = new Option("11 Mbps", "11");
		if (ht_mcs.indexOf("33") == 0)
			document.wireless_basic.abg_rate.options.selectedIndex = 0;
		else if (ht_mcs.indexOf("0") == 0)
			document.wireless_basic.abg_rate.options.selectedIndex = 1;
		else if (ht_mcs.indexOf("1") == 0)
			document.wireless_basic.abg_rate.options.selectedIndex = 2;
		else if (ht_mcs.indexOf("2") == 0)
			document.wireless_basic.abg_rate.options.selectedIndex = 3;
		else if (ht_mcs.indexOf("3") == 0)
			document.wireless_basic.abg_rate.options.selectedIndex = 4;
	}
	else
	{
		document.getElementById("div_abg_rate").style.visibility = "hidden";
		document.getElementById("div_abg_rate").style.display = "none";
		document.wireless_basic.abg_rate.disabled = true;
	}

	document.getElementById("div_mbssidapisolated").style.visibility = "hidden";
	document.getElementById("div_mbssidapisolated").style.display = "none";
	document.wireless_basic.id2197.disabled = true;
	if (mssidb == "1")
	{
		document.getElementById("div_mbssidapisolated").style.visibility = "visible";
		document.getElementById("div_mbssidapisolated").style.display = StylDispOn();
		document.wireless_basic.id2197.disabled = false;
		if (mbssidapisolated == "1")
			document.wireless_basic.id2197[0].checked = true;
		else
			document.wireless_basic.id2197[1].checked = true;
	}

	InsExtChOpt();

	if (1*is3t3r == 1) {
		for (i = 16; i < 24; i++) {
			document.wireless_basic.id2255.options[i] = new Option(i, i);
		}
	}
	var mcs_length = document.wireless_basic.id2255.options.length;
	if (1*is3t3r == 1) {
		document.wireless_basic.id2255.options[mcs_length] = new Option("32", "32");
		mcs_length++;
		document.wireless_basic.id2255.options[mcs_length] = new Option("Auto", "33");
		mcs_length++;
	}

	var ht_mcs_nm = 1*ht_mcs.split(";", 1);
        if (ht_mcs_nm <= 23)
                document.wireless_basic.id2255.options.selectedIndex = ht_mcs_nm;
        else if (ht_mcs_nm == 32)
		document.wireless_basic.id2255.options.selectedIndex = mcs_length-2;
        else if (ht_mcs_nm == 33)
		document.wireless_basic.id2255.options.selectedIndex = mcs_length-1;


	var OptLen = document.wireless_basic.id2247.options.length;

	if (1*ht_extcha == 0)
	{
		if (OptLen > 1)
			document.wireless_basic.id2247.options.selectedIndex = 0;
	}
	else if (1*ht_extcha == 1)
	{
		if (OptLen > 1)
			document.wireless_basic.id2247.options.selectedIndex = 1;
	}
	else
	{
		document.wireless_basic.id2247.options.selectedIndex = 0;
	}

	if ((1*PhyMode == 8) || (1*PhyMode == 11))
	{
		if (document.wireless_basic.id2167.options.selectedIndex == 0)
		{
			document.getElementById("extension_channel").style.visibility = "hidden";
			document.getElementById("extension_channel").style.display = "none";
			document.wireless_basic.id2247.disabled = true;
		}
	}
	else if ((1*PhyMode == 9) || (1*PhyMode == 6))
	{
		if (document.wireless_basic.id2167.options.selectedIndex == 0)
		{
			document.getElementById("extension_channel").style.visibility = "hidden";
			document.getElementById("extension_channel").style.display = "none";
			document.wireless_basic.id2247.disabled = true;
		}
	}
	id2165Change();
}

function id2165Change() {
    var wmode = document.wireless_basic.id2165.options.selectedIndex;
    if (wmode == 3) {
        $("#div_11n").show();
        InsExtChOpt();
    } else if (wmode == 4) {
        $("#id2248_1").attr("checked", true);
        $("#div_11n").show();
        InsExtChOpt();
    } else if (wmode == 0 || wmode == 1) {
        $("#div_11n").hide();
        $("#id2248_1").attr("checked", true);
        InsExtChOpt();
    } else {
        $("#div_11n").hide();
        InsExtChOpt();
    }

    //ABG Rate
    if ((wmode == 0) || (wmode == 2) || (wmode == 5)) {
        document.wireless_basic.abg_rate.options.length = 0;
        document.wireless_basic.abg_rate.options[0] = new Option("Auto", "0");
        document.wireless_basic.abg_rate.options[1] = new Option("1 Mbps", "1");
        document.wireless_basic.abg_rate.options[2] = new Option("2 Mbps", "2");
        document.wireless_basic.abg_rate.options[3] = new Option("5.5 Mbps", "5");
        document.wireless_basic.abg_rate.options[4] = new Option("6 Mbps", "6");
        document.wireless_basic.abg_rate.options[5] = new Option("9 Mbps", "9");
        document.wireless_basic.abg_rate.options[6] = new Option("11 Mbps", "11");
        document.wireless_basic.abg_rate.options[7] = new Option("12 Mbps", "12");
        document.wireless_basic.abg_rate.options[8] = new Option("18 Mbps", "18");
        document.wireless_basic.abg_rate.options[9] = new Option("24 Mbps", "24");
        document.wireless_basic.abg_rate.options[10] = new Option("36 Mbps", "36");
        document.wireless_basic.abg_rate.options[11] = new Option("48 Mbps", "48");
        document.wireless_basic.abg_rate.options[12] = new Option("54 Mbps", "54");
        if (fxtxmode == "CCK" || fxtxmode == "cck") {
            if (ht_mcs.indexOf("33") == 0)
                document.wireless_basic.abg_rate.options.selectedIndex = 0;
            else if (ht_mcs.indexOf("0") == 0)
                document.wireless_basic.abg_rate.options.selectedIndex = 1;
            else if (ht_mcs.indexOf("1") == 0)
                document.wireless_basic.abg_rate.options.selectedIndex = 2;
            else if (ht_mcs.indexOf("2") == 0)
                document.wireless_basic.abg_rate.options.selectedIndex = 3;
            else if (ht_mcs.indexOf("3") == 0)
                document.wireless_basic.abg_rate.options.selectedIndex = 6;
        }
        else {
            if (ht_mcs.indexOf("33") == 0)
                document.wireless_basic.abg_rate.options.selectedIndex = 0;
            else if (ht_mcs.indexOf("0") == 0)
                document.wireless_basic.abg_rate.options.selectedIndex = 4;
            else if (ht_mcs.indexOf("1") == 0)
                document.wireless_basic.abg_rate.options.selectedIndex = 5;
            else if (ht_mcs.indexOf("2") == 0)
                document.wireless_basic.abg_rate.options.selectedIndex = 7;
            else if (ht_mcs.indexOf("3") == 0)
                document.wireless_basic.abg_rate.options.selectedIndex = 8;
            else if (ht_mcs.indexOf("4") == 0)
                document.wireless_basic.abg_rate.options.selectedIndex = 9;
            else if (ht_mcs.indexOf("5") == 0)
                document.wireless_basic.abg_rate.options.selectedIndex = 10;
            else if (ht_mcs.indexOf("6") == 0)
                document.wireless_basic.abg_rate.options.selectedIndex = 11;
            else if (ht_mcs.indexOf("7") == 0)
                document.wireless_basic.abg_rate.options.selectedIndex = 12;
        }

        document.getElementById("div_abg_rate").style.visibility = "visible";
        document.getElementById("div_abg_rate").style.display = StylDispOn();
        document.wireless_basic.abg_rate.disabled = false;
    }
    else if (wmode == 1) {
        document.wireless_basic.abg_rate.options.length = 0;
        document.wireless_basic.abg_rate.options[0] = new Option("Auto", "0");
        document.wireless_basic.abg_rate.options[1] = new Option("1 Mbps", "1");
        document.wireless_basic.abg_rate.options[2] = new Option("2 Mbps", "2");
        document.wireless_basic.abg_rate.options[3] = new Option("5.5 Mbps", "5");
        document.wireless_basic.abg_rate.options[4] = new Option("11 Mbps", "11");
        if (ht_mcs.indexOf("33") == 0)
            document.wireless_basic.abg_rate.options.selectedIndex = 0;
        else if (ht_mcs.indexOf("0") == 0)
            document.wireless_basic.abg_rate.options.selectedIndex = 1;
        else if (ht_mcs.indexOf("1") == 0)
            document.wireless_basic.abg_rate.options.selectedIndex = 2;
        else if (ht_mcs.indexOf("2") == 0)
            document.wireless_basic.abg_rate.options.selectedIndex = 3;
        else if (ht_mcs.indexOf("3") == 0)
            document.wireless_basic.abg_rate.options.selectedIndex = 4;

        document.getElementById("div_abg_rate").style.visibility = "visible";
        document.getElementById("div_abg_rate").style.display = StylDispOn();
        document.wireless_basic.abg_rate.disabled = false;
    }
}

function CheckValue()
{
	if (document.wireless_basic.id2164.value == "")
	{
		alert(wireless_basic.validator);
		document.wireless_basic.id2164.focus();
		document.wireless_basic.id2164.select();
		return false;
	}
	return true;
}

</script>
